<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    let a = 'name'

    let obj = {}
    obj[a] = 'tom'
    console.log(obj)
</script>
</body>
</html>